package org.example.judge_admin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.judge_admin.mapper.MyFileMapper;
import org.example.judge_admin.service.MyFileService;
import org.example.judge_common.util.IdWorker;
import org.example.judge_pojo.MyFile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service("MyFileServiceImpl")
public class MyFileServiceImpl extends ServiceImpl<MyFileMapper, MyFile> implements MyFileService {

    @Autowired
    private IdWorker idWorker;
    @Override
    public boolean save(MyFile entity) {
        entity.setId(idWorker.nextId().toString());
        entity.setCreateTime(new Date());
        return super.save(entity);
    }
}
